using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._ContingentValues
{
    /// <summary>
    /// <para>Create Field Group</para>
    /// <para>Create a field group for a feature class or table. Field groups are used when creating contingent values.</para>
    /// <para>为要素类或表创建字段组。创建条件值时使用字段组。</para>
    /// </summary>    
    [DisplayName("Create Field Group")]
    public class CreateFieldGroup : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public CreateFieldGroup()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_target_table">
        /// <para>Target Table</para>
        /// <para>The input geodatabase table or feature class in which the field group will be created.</para>
        /// <para>将在其中创建字段组的输入地理数据库表或要素类。</para>
        /// </param>
        /// <param name="_name">
        /// <para>Field Group Name</para>
        /// <para>The name of the field group that will be created. This name must be unique to the feature class or table that will contain the field group.</para>
        /// <para>将创建的字段组的名称。此名称对于将包含字段组的要素类或表必须是唯一的。</para>
        /// </param>
        /// <param name="_fields">
        /// <para>Fields</para>
        /// <para>The names of the fields in the field group.</para>
        /// <para>字段组中字段的名称。</para>
        /// </param>
        public CreateFieldGroup(object _target_table, object _name, List<object> _fields)
        {
            this._target_table = _target_table;
            this._name = _name;
            this._fields = _fields;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Create Field Group";

        public override string CallName => "management.CreateFieldGroup";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_target_table, _name, _fields, _out_table, _is_restrictive.GetGPValue()];

        /// <summary>
        /// <para>Target Table</para>
        /// <para>The input geodatabase table or feature class in which the field group will be created.</para>
        /// <para>将在其中创建字段组的输入地理数据库表或要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Target Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _target_table { get; set; }


        /// <summary>
        /// <para>Field Group Name</para>
        /// <para>The name of the field group that will be created. This name must be unique to the feature class or table that will contain the field group.</para>
        /// <para>将创建的字段组的名称。此名称对于将包含字段组的要素类或表必须是唯一的。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field Group Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _name { get; set; }


        /// <summary>
        /// <para>Fields</para>
        /// <para>The names of the fields in the field group.</para>
        /// <para>字段组中字段的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Fields")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _fields { get; set; }


        /// <summary>
        /// <para>Updated Table</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Table")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_table { get; set; }


        /// <summary>
        /// <para>Is Restrictive</para>
        /// <para><xdoc>
        ///   <para>Specifies if the field group is restrictive. This parameter allows you to control the editing experience when using contingent values.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The field group is restrictive. Values entered on a field in the field group are restricted to those specified as contingent values. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—The field group is not restrictive. Values can be committed to a field in a field group even if they are not specified as contingent values.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定字段组是否具有限制性。此参数允许您在使用条件值时控制编辑体验。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 字段组为限制性字段组。在字段组中的字段上输入的值仅限于指定为条件值的值。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 字段组不具有限制性。即使未将值指定为条件值，也可以将值提交到字段组中的字段。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Is Restrictive")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _is_restrictive_value _is_restrictive { get; set; } = _is_restrictive_value._true;

        public enum _is_restrictive_value
        {
            /// <summary>
            /// <para>RESTRICT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("RESTRICT")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>DO_NOT_RESTRICT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("DO_NOT_RESTRICT")]
            [GPEnumValue("false")]
            _false,

        }

        public CreateFieldGroup SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}